﻿@{
    ViewBag.Title = "Libraries";
}
@section Menu
{
    @Html.Partial("~/Views/Menu/Routine.cshtml", new ViewDataDictionary())
}
<script type="text/javascript">
    $(function () {
        $("#divLibraryHistory").dialog({ autoOpen: false, modal: true, resizable: false, width: 600 });
    });

    function openUpdateLibraryDialog() {
        $("#divUpdateLibrary").dialog({ modal: true, resizable: false, width: 400 });
    }

    function openLibraryVersionsDialog(libraryId) {
        $("#divLibraryHistory").dialog('open');
        $('#LibraryId').val(libraryId);
    }
</script>
<div class="buttons">
@Ajax.ActionLink("Create new", "ActionForm", null, new AjaxOptions { UpdateTargetId = "divUpdateLibrary", OnBegin = "openUpdateLibraryDialog" }, 
                     new { @class = "btn btn-primary"  })
</div>

<br />
<br />
<div id="divIndexLibrary">
    @Html.Action("Index")
</div>
<div id="divUpdateLibrary" title="Library form">
</div>
<div id="divLibraryHistory" title="History">
    @*@Ajax.ActionLink("Create new", "Create", "LibraryVersion", new AjaxOptions { UpdateTargetId = "divCreateLibraryVersion", OnComplete = "$('#divCreateLibraryVersion').show();" })*@
    @*@Ajax.ActionLink("Create new", "Create", "LibraryVersion", new AjaxOptions { UpdateTargetId = "divCreateLibraryVersion"})*@
    <br/>
    <div id="divCreateLibraryVersion">
        @Html.Action("Create", "LibraryVersion")
    </div>
    <div id="divIndexLibraryHistory">
    </div>
</div>
